@extends('admin.app')

@section('breadcrumb')
    <div class="bg-light lter b-b wrapper-md">
        <ol class="breadcrumb bg-light lter m-n no-padder">
            <li><a href="{{ admin_action('HomeController@index') }}">主页</a></li>
            <li>业务管理</li>
            <li class="active">还款管理</li>
        </ol>
    </div>
@endsection

@section('content')
    <div class="panel panel-default">
        <div class="panel-heading font-bold">
            还款记录
        </div>
        <div class="row wrapper">
            <div class="col-sm-8">
                <form class="form-horizontal" method="get"
                      action="{{ admin_action('Business\RepaymentManagementController@index') }}">
                    <div class="row">
                        <div class="col-sm-5">
                            <div class="form-group">
                            </div>
                        </div>
                        <div class="col-sm-1 text-left">
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th>交易流水号</th>
                    <th>投资人姓名</th>
                    <th>还款总金额(元)</th>
                    <th>还款金额(元)</th>
                    <th>应还利息(元)</th>
                    <th>应还款时间</th>
                    <th>实际还款时间</th>
                    <th>还款状态</th>
                </tr>
                </thead>
                <tbody>
                @forelse ($data as $d)
                    <tr>
                        <td>{{ $d->sn??'--' }}</td>
                        <td>{{ $d->user_name??'--' }}</td>
                        <td>{{ ($d->money + $d->profit)??0 }}</td>
                        <td>{{ $d->money??0 }}</td>
                        <td>{{ $d->profit??0 }}</td>
                        <td>{{ $d->input_time??'--' }}</td>
                        <td>{{ $d->pay_time??'--' }}</td>
                        <td>
                        	@if($d->status == 1)
                        		还款完成
                    		@elseif($d->status == 0)
                    			还款中
                    		@else
                    			还款失败
                    		@endif
                        </td>
                    </tr>
                @empty
                    <tr>
                        <td colspan="3" class="text-center">没有找到还款记录</td>
                    </tr>
                @endforelse
                </tbody>
            </table>
        </div>
        <div class="panel-footer">
            <div class="row">
                <div class="col-sm-12 text-right text-center-xs">
                    {!! $links !!}
                </div>
            </div>
        </div>
    </div>
@endsection